﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YWTSSys.DAL;
using YWTSSys.Model;
using YWTSSys.Library;
using System.Data;
namespace YWTSSys.BLL
{
    public class SMSProccessController
    {
        /// <summary>
        /// 添加短信需处理记录
        /// </summary>
        /// <param name="SMSSouce"></param>
        /// <param name="ObjId"></param>
        /// <param name="SMSTempleteKeyOrContent"></param>
        /// <returns></returns>
        public static int Add(string SMSSouce, string ObjId, string SMSTempleteKeyOrContent)
        {
            return  SMSProccessDAL.Add(SMSSouce, ObjId, SMSTempleteKeyOrContent);
        }
        /// <summary>
        /// 获取所有未处理记录
        /// </summary>
        /// <returns></returns>
        public static DataTable GetNeedPorccessAll()
	    {
            return SMSProccessDAL.GetNeedPorccessAll();
	    }
        /// <summary>
        /// 更新已处理
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static bool Update(int ID)
        {
            return SMSProccessDAL.Update(ID);
        }
        /// <summary>
        /// 根据来源获取需处理的内容,可用于处理一天只处理一次的情况,只需判断记录存不存在
        /// </summary>
        /// <returns></returns>
        public static DataTable GetBySMSSouce(string SMSSouce)
        {
            return SMSProccessDAL.GetBySMSSouce(SMSSouce);
        }
        /// <summary>
        /// 获取短信发送列表
        /// </summary>
        /// <param name="whereSql"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <param name="Sort"></param>
        /// <param name="TotalCount"></param>
        /// <returns></returns>
        public static DataTable SMSList_GetPagination(string whereSql, int PageIndex, int PageSize, string Sort, ref int TotalCount)
        {
            return SMSProccessDAL.SMSList_GetPagination(whereSql, PageIndex, PageSize, Sort, ref  TotalCount);
        }
    }
}
